home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / MacFormat 92 CD / Shareware Plus / Utilities / FolderSynchronizer 1.8.9 / PlugIn / Dialog / 00038_fAnno.ls < prev    next >
Encoding:
Text File  |  2000-04-17  |  944 b   |  40 lines

  1. on keyDown
  2.   global gMonth
  3.   if (the key = TAB) or (the key = RETURN) then
  4.     if value(field "fGiorno") > MaxGiorno() then
  5.       beep()
  6.     end if
  7.     set the selEnd to length(field "fGiorno")
  8.     set the selStart to 0
  9.     if the key = TAB then
  10.       pass()
  11.     end if
  12.   end if
  13.   if ((the keyCode >= 123) and (the keyCode <= 126)) or (the keyCode = 51) then
  14.     pass()
  15.   end if
  16.   set myNum to value(the key)
  17.   if voidp(myNum) then
  18.     exit
  19.   end if
  20.   set myTempNum to field "fAnno"
  21.   set s to the selStart
  22.   set e to the selEnd
  23.   set the selEnd to s + 1
  24.   set the selStart to s + 1
  25.   if s <> e then
  26.     set s to s + 1
  27.     put the key into char s to e of myTempNum
  28.   else
  29.     if s = 0 then
  30.       put the key before myTempNum
  31.     else
  32.       put the key after char s of myTempNum
  33.     end if
  34.   end if
  35.   put "v" && value(myTempNum)
  36.   if (value(myTempNum) <= 9999) and (length(myTempNum) <= 4) then
  37.     put myTempNum into field "fAnno"
  38.   end if
  39. end
  40.